package com.haidung.photojourney.vos;

import android.graphics.Bitmap;
import android.media.ExifInterface;

public class JourneyImage {

    private double mLongtitue;
    private double mLatitue;
    private String absolutePath;
    private Bitmap mThumbnail;

    public JourneyImage(String absolutePath) throws Exception {
        this.absolutePath = absolutePath;
        ExifInterface image = new ExifInterface(absolutePath);

        float[] latlong = new float[2];
        boolean valid = image.getLatLong(latlong);

        if (valid) {
            this.mLatitue = latlong[0];
            this.mLongtitue = latlong[1];
        }
    }

    public double getLatitue() {
        return mLatitue;
    }

    public JourneyImage latitue(double mLatitue) {
        this.mLatitue = mLatitue;
        return this;
    }

    public double getLongtitue() {
        return mLongtitue;
    }

    public JourneyImage longtitue(double mLongtitue) {
        this.mLongtitue = mLongtitue;
        return this;
    }

    public Bitmap getThumbnail() {
        return mThumbnail;
    }

    public JourneyImage thumbnail(Bitmap mThumbnail) {
        this.mThumbnail = mThumbnail;
        return this;
    }

    public String getAbsolutePath() {
        return absolutePath;
    }

}
